<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ include file="/WEB-INF/views/shop/app/app_base.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="format-detection" content="telephone=no, email=no"/>
	<meta charset="UTF-8">
	<title>订单详情</title>
	<link rel="stylesheet" href="<%=basePath%>/static/shop/app/css/core.css">
	<link rel="stylesheet" href="<%=basePath%>/static/shop/app/css/icon.css">
	<link rel="stylesheet" href="<%=basePath%>/static/shop/app/css/home.css">
	<link rel="stylesheet" href="<%=basePath%>/static/admin/app/js/layer/skin/layer.css">
	<link rel="shortcut icon" href="<%=basePath%>/favicon.ico" type="image/x-icon" />
	<link href="<%=basePath%>/favicon.ico" sizes="114x114" rel="apple-touch-icon-precomposed">
	<script> var baselocation='<%=basePath%>';</script>
</head>
<body>
	<header class="aui-header-default aui-header-fixed aui-header-bg">
		<a href="javascript:history.back(-1)" class="aui-header-item">
			<i class="aui-icon aui-icon-back-white"></i>
		</a>
		<div class="aui-header-center aui-header-center-clear">
			<div class="aui-header-center-logo">
				<div class="aui-car-white-Typeface">订单详情</div>
			</div>
		</div>
		<a href="javascript:;" class="aui-header-item-icon select" style="min-width:0;">
			<i class="aui-icon aui-icon-share-pd selectVal" onselectstart="return false"></i>
			<div class="aui-header-drop-down selectList">
				<div class="aui-header-drop-down-san"></div>
				<div class="">
					<p class="" onclick="location='<%=basePath%>/${shop.code }'">首页</p>
					<c:if test="${not empty loginName }">
					<p class="" onclick="location='<%=basePath%>/${shop.code }/${loginName}/order/list'">我的订单</p>
					</c:if>
				</div>
			</div>
		</a>
	</header>
	<section class="aui-address-content">
		<div class="aui-prompt"><i class="aui-icon aui-prompt-sm"></i>请注意核对您的收获信息，并做好收货准备。</div>
		<div class="aui-address-box">
			<div class="aui-address-box-list">
				<a class="aui-address-box-default">
					<ul>
						<li>
							<strong id="strong-name">${order.buyerName }</strong>
						</li>
						<li>
							<strong id="strong-mobile">手机号：${order.buyerCode }</strong>
						</li>
						<li>
							<strong id="strong-weixin">微信号：${order.buyerWeixin }</strong>
						</li>
						<li id="li-address">
							<i class="aui-icon aui-icon-address"></i>
							${order.address }
						</li>
					</ul>
				</a>
			</div>
		</div>
		<div class="aui-dri"></div>
		<!-- 订单购买用户信息 -->
		<input id="id" type="hidden" value="${order.id }">
		<input id="buyerWeixin" type="hidden" value="${order.buyerWeixin }">
		<input id="address" type="hidden" value="${order.address }">
		<!-- 订单信息 -->
		<input id="productId" type="hidden" value="${product.id }">
		<input id="shopId" type="hidden" value="${product.shopId }">
		<input id="productName" type="hidden" value="${order.productName }">
		<input id="price" type="hidden" value="${order.price }">
		<input id="spec" type="hidden" value="${order.spec }">
		<input id="cate" type="hidden" value="${order.cate }">
		<input id="brand" type="hidden" value="${order.brand }">
		<input id="productionPlace" type="hidden" value="${order.productionPlace }">
		<input id="status" type="hidden" value="${order.status }">
		<input id="payStatus" type="hidden" value="${order.payStatus }">
		<div class="aui-list-product-float-item">
			<div class="aui-car-box-list">
				<ul>
					<li>
						<div class="aui-car-box-list-item">
							<div class="aui-car-box-list-img">
								<a href="<%=basePath%>/product/${product.id }">
									<div class="picMainImagecontain">
										<img id="picMainImage" src="${order.picMain }" alt="">
									</div>
								</a>
							</div>
							<div class="aui-car-box-list-text">
								<h4>
									<a href="<%=basePath%>/product/${product.id }">${order.productName }</a>
								</h4>
								<div class="aui-car-box-list-text-brief">
									<c:if test=""><span>规格:${order.spec }</span></c:if>
									<c:if test=""><span>品牌:${order.brand }</span></c:if>
									<c:if test=""><span>产地:${order.productionPlace }</span></c:if>
								</div>
								<div class="aui-car-box-list-text-price">
									<div class="aui-car-box-list-text-pri">
										￥<b class="price">${order.price }</b>
									</div>
									<div class="aui-car-box-list-text-arithmetic">
										<span id="productNum" class="num">${order.num }</span>
									</div>
								</div>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
		<div class="aui-address-well" style="padding-bottom:0px">
			<div class="aui-dri"></div>
			<a href="#" class="aui-address-cell aui-fl-arrow-clear">
				<div class="aui-address-cell-bd">
					<h3>订单总金额</h3>
					<p>免运费</p>
				</div>
				<div class="aui-address-cell-ft">
					<span id="span-total-amount" class="aui-red">￥${order.price }</span><br>
				</div>
			</a>
			<div class="aui-dri"></div>
			<textarea id="remark" class="aui-Address-box-text" placeholder="如有特殊需求，请填写备注信息" rows="3">${order.remark }</textarea>
			<div class="aui-dri"></div>
		</div>
	</section>
	<section class="aui-settle-content" style="padding-top:0px">
		<div class="aui-settle-pay" style="font-size:18px">
			订单总额：￥${order.totalAmount }
			<br>已支付金额：￥${payTotalAmount }
			<br>店主已确认收款金额：￥${order.payAmount }
		</div>
		<div class="aui-settle-title">
			<p>还需要继续支付:<span>${order.noPayAmount }元</span>（如已支付,请忽略!）</p>
		</div>
		<div class="aui-settle-pay">
			我的支付记录
		</div>
		<div class="aui-dri"></div>
		<c:if test="${empty payList}"><h3>暂无支付记录</h3></c:if>
		<c:forEach var="pay" items="${payList}">
		<div style="border-bottom:1px dashed;">
			<a href="<%=basePath%>/order/${pay.orderId }/pay/${pay.id }/go-pay" class="aui-address-cell aui-fl-arrow aui-fl-arrow-clear">
				<div class="aui-address-cell-hd">
					<img src="<%=basePath%>/static/shop/app/img/icon/apy-${pay.payMethod }.png" alt="">
				</div>
				<div class="aui-address-cell-bd">
					${pay.payMethodName }（${pay.payAccount }）
					<p>￥${pay.payMoney }（<fmt:formatDate value="${pay.createdTime }" pattern="yyyy-MM-dd HH:mm:ss"/>）</p>
				</div>
				<div class="aui-address-cell-ft">${pay.statusName }</div>
			</a>
		</div>
		</c:forEach>
		<div class="aui-settle-ways">
			支付方式
		</div>
		<div class="aui-settle-choice">
			<a id="payMethod_zhifubao" class="aui-address-cell  aui-fl-arrow-clear">
				<div class="aui-address-cell-hd">
					<img src="<%=basePath%>/static/shop/app/img/icon/apy-1.png" alt="">
				</div>
				<div class="aui-address-cell-bd">
					支付宝支付
					<p>支付宝安全支付</p>
				</div>
				<div class="aui-address-cell-ft"><input id="payMethod_input_zhifubao" type="checkbox" class="check check-pay goods-check goodsCheck"></div>
			</a>
			<a id="payMethod_weixin" class="aui-address-cell  aui-fl-arrow-clear">
				<div class="aui-address-cell-hd">
					<img src="<%=basePath%>/static/shop/app/img/icon/apy-2.png" alt="">
				</div>
				<div class="aui-address-cell-bd">
					微信支付
					<p>微信安全支付</p>
				</div>
				<div class="aui-address-cell-ft"><input id="payMethod_input_weixin" checked type="checkbox" class="check check-pay goods-check goodsCheck" ></div>
			</a>
			<a id="payMethod_other" class="aui-address-cell  aui-fl-arrow-clear">
				<div class="aui-address-cell-hd">
					<img src="<%=basePath%>/static/shop/app/img/icon/apy-3.png" alt="">
				</div>
				<div class="aui-address-cell-bd">
					其他支付方式
					<p>请在备注写明支付方式</p>
				</div>
				<div class="aui-address-cell-ft"><input id="payMethod_input_other" type="checkbox" class="check check-pay goods-check goodsCheck"></div>
			</a>
		</div>
		
		<input id="orderId" type="hidden" value="${order.id }">
		<input id="ts" type="hidden" value="${order.ts }">
		<input id="buyerCode" type="hidden" value="${order.buyerCode }">
		<input id="buyerName" type="hidden" value="${order.buyerName }">
		<input id="noPayAmount" type="hidden" value="${order.noPayAmount }">
		<input id="payMethod" type="hidden" value="2">
		
		<c:if test="${order.status != 7 and order.status != 6}">
			<c:if test="${order.payStatus == 0 or order.payStatus == 1}">
				<div class="aui-prompt"><i class="aui-icon aui-prompt-sm"></i>请准确填写您的支付信息,便于店主确认</div>
				<div class="aui-Address-box">
					<p>
						<input id="payAccount" class="aui-Address-box-input" type="text" placeholder="支付账号(微信或支付宝账号)">
					</p>
					<p>
						<input id="payMoney" class="aui-Address-box-input" type="text" placeholder="支付金额" value="${order.noPayAmount }">
					</p>
					<p>
						<textarea id="address" class="aui-Address-box-text" placeholder="备注" rows="3"></textarea>
					</p>
				</div>
			</c:if>
			<c:if test="${order.dr == 1 and (order.status == 3 or order.status == 4)}">
           		<div class="aui-settle-pay" style="font-size:18px">
					快递公司：${order.sendCompany }
					<br>发货时间：<fmt:formatDate value="${order.sendTime }" pattern="yyyy-MM-dd"/>
					<br>发货单号：${order.sendNo}
				</div>
			</c:if>
		</c:if>
	</section>
	<div class="aui-settle-payment">
		<c:if test="${order.status != 7 and order.status != 6}">
			<c:if test="${order.payStatus == 0 or order.payStatus == 1}">
			<a id="savePayBtn">微信支付${order.noPayAmount } 元</a>
			</c:if>
			<c:if test="${order.dr == 1 and order.status == 3}">
	           <a onclick="updateOrderStatus('${order.id}','${order.ts}','4')">确认收货</a>
			</c:if>
			<c:if test="${order.dr == 1 and order.status == 4}">
	           <a onclick="updateOrderStatus('${order.id}','${order.ts}','5')">订单完成</a>
			</c:if>
		</c:if>
	</div>
	<script type="text/javascript" src="<%=basePath%>/static/shop/app/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/static/shop/app/js/jquery.cookie.js"></script>
	<script rel="script" src="<%=basePath%>/static/admin/app/js/layer/layer.js"></script>
	<script src="<%=basePath%>/static/shop/app/js/aui-down.js"></script>
	<script rel="script" src="<%=basePath%>/static/admin/app/js/common.js"></script>
	<script type="text/javascript" src="<%=basePath%>/static/shop/app/js/my_pic_view.js"></script>
	<script type="text/javascript" src="<%=basePath%>/static/shop/app/js/order.js"></script>
	<script type="text/javascript" src="<%=basePath%>/static/shop/app/js/pay.js"></script>
	<script type="text/javascript">
	window.onload=function () {
	    //显示商品图
	    show_pic_view('90','90','picMainImage');
	}
	</script>
</body>
</html>